package map;

import java.util.HashMap;
import java.util.concurrent.ConcurrentHashMap;

public class HashMapTest2 {

	public static void main(String[] args) {
		long start = System.currentTimeMillis();

		int count = 10000000;
//		HashMap<Integer, Integer> map = new HashMap<>();
		ConcurrentHashMap<Integer, Integer> map = new ConcurrentHashMap<>();
		for(int i = 0; i < count; i++){
			map.put(i, i);
		}
		System.out.println((System.currentTimeMillis() - start) / 1000.0);

		start = System.currentTimeMillis();
		for(int i = 0; i < count; i++){
			map.get(i);
		}
		System.out.println((System.currentTimeMillis() - start) / 1000.0);
	}
}